package Menu
{
	import Game.GameMain2;
	
	import flash.display.SimpleButton;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	
	import flashx.textLayout.elements.OverflowPolicy;

	public final class PlayPage extends BasePage
	{
		private var btnMenu:SimpleButton;
		private var game:GameMain2;
		public function PlayPage(_vis:Sprite)
		{
			super(_vis);
			btnMenu=visual.getChildByName("btnMenu") as SimpleButton;
			btnMenu.addEventListener(MouseEvent.CLICK,btnClickHandler);
		}
		public override function start():void{
			game=new GameMain2;
			addChildAt(game,0);
		}
		private function btnClickHandler(e:MouseEvent):void{
			switch (e.currentTarget){
				case btnMenu:
					removeChild(game);
					dispatchEvent(new PageEvent(PageEvent.NEED_PAGE,MenuPage));
				break;
			}
		}
	}
}